package com.seqb.utils;

import com.aspose.words.Document;

/**
 * @author lilinshen
 * @title wordtopdfdemo
 * @description Java利用aspose-words将word文档转换成pdf（破解 无水印）
 * @date 2022/09/26
 */
public class Doc2pdf {

    public static void wordToPdf(String path, String newFilePath) {
        try {
            Document doc = new Document(path);
            doc.save(newFilePath);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) throws Exception {
        Doc2pdf.wordToPdf("d:\\word\\demo.doc", "d:\\word\\demo.pdf");
    }

}
